home *** CD-ROM | disk | FTP | other *** search
- Path: news.acns.nwu.edu!merle!sksen
- From: sksen@merle.acns.nwu.edu (Subhro Sen)
- Newsgroups: comp.lang.c
- Subject: Trying to store a triangular matrix
- Date: 18 Jan 96 07:24:43 GMT
- Organization: Northwestern University, Evanston, IL, US
- Message-ID: <sksen.821949883@merle>
- Reply-To: sen@nwu.edu (Subhro Sen)
- NNTP-Posting-Host: merle.acns.nwu.edu
-
-
- I am trying to store a 2D lower triangular N x N matrix in
- a 1D array...in other words i want A[i][j] to
- map to some index m. What's the formula!?!?!
- It's a lower triangular matrix, (A[i][j] = 0 for j > i)
- i.e.:
-
-
- 1 0 0 0
- 2 1 0 0
- 5 3 2 0
- 9 3 4 1
-
- at first i had:
-
- m = i*N + j where N=one dimension of matrix
- --
- sen@nwu.edu s u b h r o s e n
- http://www.eecs.nwu.edu/~sksen/ northwestern university
- PGP key: finger sksen@merle.acns.nwu.edu 2245 sheridan road, #409
- evanston, illinois 60201
-